x11: ensure some context is bound before calling glClientWaitSync
authorRay Strode <rstrode@redhat.com>
Mon, 22 Jun 2020 21:13:54 +0000 (17:13 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 22 Jun 2020 21:13:54 +0000 (17:13 -0400)
commita0f6ff101e781aaf0a931be6e22f2885f4f69e04
treedff2bdee6868e58422189b99549cf04a242deabe
parent367d24be7f64469b1fd52c558101b7baa4c26810
x11: ensure some context is bound before calling glClientWaitSync

Since commit 972134abe48a4c9c7b6ad41b0723f30f4e7ae16b we now call
glClientWaitSync for the vendor nvidia driver, to know when a frame
is ready for the compositor to process.

glClientWaitSync can be called regardless of which context is currently
bound, but if no context is bound at all, it returns 0 without
doing anything.

This commit checks for that edge case, and ensures a context gets
made current in the event no context is already current, before calling
glClientWaitSync.
gdk/x11/gdkglcontext-x11.c